<?php Class popup_model extends CI_Model
{	
	function __construct()
	{
		parent::__construct();
	}
	function get_location_select($id_zone=230){ // lấy danh sách tỉnh thành phố 
		$info_location = $this->db->where("country_id",$id_zone)->get("country_zones")->result();
		$list = "";
		if(!empty($info_location)){
			foreach	($info_location as $item){
				$list[$item->id] = $item->name; 	
			}
		}
		return $list;
	}
	function get_category_product_select($parent_id=0){
		$info = $this->db->get_where("categories",array("parent_id"=>$parent_id,"enabled"=>1))->result();
		$list = "";
		if(!empty($info)){
			foreach($info as $item){
				$list[$item->id] = $item->name;
			}	
		}
		return $list;
	}
	function insert($table,$data_insert){
		$this->db->insert($table,$data_insert);
		return $this->db->insert_id();
	}
}